home *** CD-ROM | disk | FTP | other *** search
/ TOS Silver 2000 / TOS Silver 2000.iso / Falcon / WINREC / DOKU / ENGLISH / DVS.TXT < prev    next >
Encoding:
Text File  |  1994-08-31  |  4.0 KB  |  140 lines

  1. DVSM Samples
  2. ------------
  3.  
  4. Every DVS sample begins with the following header:
  5.  
  6. typedef struct
  7. {
  8.     char magic[6];     
  9.     int headlen;       
  10.     unsigned int freq;          
  11.     char pack;        
  12.     char mode;        
  13.     long blocklen;     
  14. } DVSMHEAD;
  15.  
  16.  
  17. magic:
  18.     "DVSM\0\0"
  19. headlen:
  20.     header length = distance of the sound data from the start of file
  21.     Please use this entry to skip extension blocks (see below). The header length
  22.     has to be a even value!
  23. freq:
  24.     sampling frequency:
  25.             0-7 : allowed CODEC frequencies (0: 8kHz ...  7: 49kHz)
  26.             >256: sampling frequency in Hz
  27. pack:
  28.     0: ungepacked data
  29.     2: DVS delta packed data
  30.     4: DVS voice packed data (only WinRec Pro)
  31.     5: ADPCM (only WinRec Pro)
  32.     In future other values are possible. So test for 'pack==x' and NOT for 'pack>0'
  33. mode:
  34.     Bit 0: 8/16 Bit
  35.     Bit 1: Stereo/Mono
  36. blocklen (only valid if 'pack'==2 and 'pack'==4 , at the moment):
  37.     Length of a packed block. This is NOT a fixed value. WinRec write different
  38.     block lengths, dependent of the used buffer. 'blocklen' has to be an
  39.     even number!
  40.     
  41. extensions blocks
  42. -----------------
  43. DVS is modular format. The minimal header (16 bytes, see above) could followed by
  44. free extensions blocks. These blocks are a part of the header and the entry 'headlen'
  45. inludes this blocks. So (older) programms can skip this additional information.
  46.  
  47. A block has the following structure:
  48.  
  49.      4 Byte (cookie)   Identify
  50.      2 Byte (len)      Length
  51.  len-6 Bytes Data
  52.  
  53. WinRec knows (V1.38 and higher) following extensions:
  54.  
  55. cookie            Lenght of the data    Usage
  56. -----------------------------------------------------------------------------------------
  57. 'CLCK'            1 word                 0: intern clock, 1: extern CD, 2: extern DAT
  58.  
  59. 'PEAK'            4 byte                one word for the left and right channel containing the
  60.                                     highest sample value
  61.                                     
  62. 'DSPE'            x bytes                DSP program (soundeffect !!) in binary format
  63.  
  64. 'PARA'            x bytes                x parameters for the sound effect. NOT before the 'DSPE'
  65.                                     block!
  66.  
  67. 'PACK'            128 or 8 bytes        Deltapack table for the distance values. Used instead of
  68.                                     the standard table (see below).
  69.                                     
  70. 'INFO'            x bytes                info text (e.g. full title)
  71.  
  72. Not use in WinRec (by now)
  73.  
  74. 'KARA'            x Bytes                karaoke text (see below)
  75.  
  76.  
  77. The maximal header length (all blocks together) is limited to 65535 Bytes. Every programm should parse
  78. the blocks, and decide to use them or not.
  79.  
  80. karaoke text format
  81. -------------------
  82.     long cookie='KARA'
  83.     int len
  84.     int textlen
  85.  
  86. followed by the text ('textlen' bytes) in standard ASCII format. After this the extension included
  87. a measure table, with a long word (4 byte) for every word in the text. The long word contains
  88. the time distance to the next word in 1/sampling frequency
  89.  
  90. deltapack format
  91. ----------------
  92.  (at the moment only for 16 Bit stereo or mono samples!!!!)
  93.  
  94. a block looks (for stereo) like this (length 'blocklen'):
  95.  
  96.  1. sound word left    (16 Bit)
  97.  1. sound word right   (16 Bit)
  98.  1. distance value left  (8 Bit)
  99.  1. distance value right (8 Bit)
  100.                  .
  101.                  .
  102.                  .
  103.  n. distance value left  (8 Bit)
  104.  n. distance value right (8 Bit)
  105.  
  106.  
  107. The distance values are pointer to a table with 'real'
  108. 16 Bit distance values. This table contains functions values of
  109.  
  110.                    / -1.084618362^-x  for x<0  (-128 to -1)
  111.             f(x)= {   0               for x=0  (0)
  112.                    \  1.084618362^x   for x>0  (1 to 127)
  113.                    
  114. The table has (logically) the length of 256 bytes.
  115.  
  116. voicepack format
  117. ----------------
  118.  (at the moment only for 16 Bit stereo or mono samples!!!!)
  119.  
  120. a block looks (for stereo) like this (length 'blocklen'):
  121.  
  122.  1. sound word left    (16 Bit)
  123.  1. sound word right   (16 Bit)
  124.  1. distance value left  (4 Bit)
  125.  1. distance value right (4 Bit)
  126.                  .
  127.                  .
  128.                  .
  129.  n. distance value left  (4 Bit)
  130.  n. distance value right (4 Bit)
  131.  
  132.  
  133. The distance values are pointer to a table with 'real'
  134. 16 Bit distance values:
  135.  
  136. -8192,-4096,-2048,-1024,-512,-256,-64,0,64,256,512,1024,2048,4096,8192
  137.  
  138.  
  139. Andreas Binner
  140.